const express = require('express');
const app = express();
const {createProxyMiddleware}=require('http-proxy-middleware')
app.use(express.static('./public'));

app.use('/api',createProxyMiddleware({
    target:'http://localhost:8080',
    changeOrigin:true,
    pathRewrite:{
        "^/api":""
    }
}))
app.get('/local/new', (req, res) => {
    res.status(201).json({ msg:222222 });
});
app.listen(3000);